//
//  FirstPerfectViewController.m
//  WZCLApp
//
//  Created by chirui on 2018/7/5.
//  Copyright © 2018年 Shui. All rights reserved.
//

#import "FirstPerfectViewController.h"

@interface FirstPerfectViewController (){
    
    NSData * UserPhotoData;
}
@property (weak, nonatomic) IBOutlet UIButton *userImageBtn;
@property (weak, nonatomic) IBOutlet UITextField *nameText;
@property (weak, nonatomic) IBOutlet UILabel *nexLabel;
@property (weak, nonatomic) IBOutlet UILabel *cityLabel;
@property (weak, nonatomic) IBOutlet UILabel *yearLabel;
@property (weak, nonatomic) IBOutlet UILabel *schoolLabel;
@property (weak, nonatomic) IBOutlet UILabel *wantSchoolLabel;
@property (weak, nonatomic) IBOutlet UIButton *sureBtn;



@end

@implementation FirstPerfectViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.userImageBtn.layer.cornerRadius = self.userImageBtn.frame.size.width/2;
    self.userImageBtn.layer.masksToBounds = YES;
    
    [self.nexLabel tapAction:^{
        
        zySheetPickerView * pickerView = [zySheetPickerView ZYSheetStringPickerWithTitle:@[@"男",@"女"] andHeadTitle:@"选择性别" Andcall:^(zySheetPickerView *pickerView, NSString *choiceString) {
            self.nexLabel.text = choiceString;
            self.nexLabel.textColor = [UIColor blackColor];
            [pickerView dismissPicker];
        }];
        [pickerView show];
    }];
}

- (IBAction)userImageBtnCLick:(id)sender {
    
    if([[UIResponder currentFirstResponder] isKindOfClass:[UITextField class]]) {
        [[UIResponder currentFirstResponder] resignFirstResponder];
    }
    [BDImagePicker showImagePickerFromViewController:self allowsEditing:YES finishAction:^(UIImage *image) {
        if (image) {
        
            UserPhotoData  = UIImageJPEGRepresentation(image, 0.5);
            [_userImageBtn setBackgroundImage:image forState:UIControlStateNormal];
        }
    }];
    
}

- (IBAction)sureBtnClick:(id)sender {
    
    
}


@end
